#ifndef ATTRIBBASEFORM_H
#define ATTRIBBASEFORM_H

#include <QWidget>
#include <QTreeWidgetItem>
#include <QTableWidgetItem>
class AttribBaseForm : public QWidget
{
    Q_OBJECT
public:
    explicit AttribBaseForm(QWidget *parent = nullptr);

public:
    //对外接口
    void SetChannelID(int channelID);
    void SetDeviceID(int deviceID);
    void SetProtoName(QString protoName);
    void SetCurrentTreeItem(QTreeWidgetItem * currentItem);
    void ShowWindow();

protected:
    //子类，重写，实现界面数据的初始化
    virtual void InitUIData();
    //子类，重写，实现保存
    virtual void saveModel();
    //判定所有编辑框
    void connectAllEdit();

private slots:
    void on_textChanged(const QString &);
    void on_status_chanaged(int value);
    void itemChanged(QTableWidgetItem *item);

signals:

protected:
    QTreeWidgetItem * m_currentTreeItem = { nullptr};
    QString m_protoName;
    bool m_initAfter{ false };
    int m_channelID { 0 };
    int m_deviceID { 0 };
};

#endif // ATTRIBBASEFORM_H
